﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class GameManager : MonoBehaviour {
	
	public static GameManager Instance;
	//核弹数量
	public  int hedan_number =5;
	Text hedan_text;
	//钻石数量
	public int zuanshi_number =0;
	Text zuanshi_text;
	
	void Start () {
	
		hedan_text = GameObject.FindGameObjectWithTag("HeDan_Text").gameObject.GetComponent<Text>();
		zuanshi_text = GameObject.FindGameObjectWithTag("ZuanShi_Text").gameObject.GetComponent<Text>();
	}
	

	void Update () {
	
		hedan_text.text ="x" + hedan_number.ToString();
		zuanshi_text.text = zuanshi_number.ToString();
	}

	//核弹
	public void zuanshi_state(int state)
	{
		switch(state)
		{
		case 0://增加核弹数量
			hedan_number++;
			break;
		case 1://减少核弹数量
			hedan_number--;
			break;
		}
	}
	//钻石
	public void zuanshi_state()
	{
		zuanshi_number++;
	}
}
